<%@page import="com.ingenio.dao.MarcaAdapter"%>
<%@page import="com.ingenio.business.Marca"%>
<%@page import="com.ingenio.dao.SubRubroAdapter"%>
<%@page import="com.ingenio.business.SubRubro"%>
<%@page import="com.ingenio.dao.RubroAdapter"%>
<%@page import="com.ingenio.business.Rubro"%>
<%@page import="java.util.List"%>
<%@page import="com.ingenio.dao.CategoriaAdapter"%>
<%@page import="com.ingenio.business.Categoria"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Generacion Pedido Proveedor</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

   <!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
   <!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
   <!--script src="js/less-1.3.3.min.js"></script-->
   <!--append ‘#!watch’ to the browser URL, then refresh the page. -->
	
   <link href="css/bootstrap.min.css" rel="stylesheet">
   <link href="css/pedido.css" rel="stylesheet">
   <link href="css/principal.css" rel="stylesheet">

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
  <![endif]-->

  <!-- Fav and touch icons -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
  <link rel="shortcut icon" href="img/favicon.png">
  
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/bootstrap.min.js"></script>
  <script type="text/javascript" src="js/pedido.js"></script>
  <script type="text/javascript" src="js/notify.min.js"></script>
</head>

<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
          </button>
          <a class="navbar-brand" href="index.jsp">InGenio</a>
        </div>
      </div>
    </nav>
<div class="container container--menu">
	<div class="row clearfix">
		<div class="col-md-12 column">
		  <form action="generarPedido" method="post">
			<div class="page-header">
				<h1>Generaci&oacute;n Pedido de Mercader&iacute;a a Proveedor</h1>
			</div>
			
			<div class="row">
			  <div class="col-md-1">
				<label class="pull-left">Proveedor</label>
			  </div>
			  <div class="col-md-1">
				<input type="text" class="form-control pull-left" name="codProveedor" id="codProveedor">
			  </div>
			  <div class="col-md-3">
				<input type="text" class="form-control pull-left" name="descProveedor" id="descProveedor" disabled>
			  </div>
			  <div class="col-md-1">
				&nbsp;
			  </div>
			  <div class="col-md-4">
				  <label class="pull-right">Fecha</label>
			  </div>
			  <div class="col-md-2 pull-right">
				  <div class='input-group date' id='datetimepicker8'>
                    <input type='text' class="form-control uneditable-input " disabled/>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
                    </span>
                   </div>
			  </div>									
			</div>
			
			<div class="clear p-bottom"></div>
						
			<div class="row" >
			  <div class="col-md-2">
				<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#buscarProveedor">Buscar Proveedor</button>
			  </div>
			</div>
			
			<!-- toda esta parte es para la ventana modal de busqueda de proveedores -->
					 <div class="modal fade" id="buscarProveedor" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					 	<div class="modal-dialog">
					 		<div class="modal-content">
					 			<div class="modal-header">
					 			 	<button type="button" class="close btnSalirProvModal" data-dismiss="modal" aria-hidden="true">&times;</button>
					 			 	<h4>Busqueda de proveedor</h4>
					 			</div>
					 			<div class="modal-body">
					 				<div class="row">
						 				<div class="row" >
								 				<div class="col-md-1">
												  &nbsp;
												</div>
												<div class="col-md-6">
									 				<input type="text" id="descripcionProveedor" name="descripcionProveedor" class="form-control">
												</div>
												<div class="col-md-1">
												  &nbsp;
												</div>
												<div class="col-md-2">
									 				<a href="#" class="btn btn-primary btn-lg"><i class="icon-white glyphicon glyphicon-search searchProv"></i></a>
												</div>									
							 				</div>
							 		</div>
					 				<div class="row modalrow2">
					 					<table class="table table-striped table-fixedheader tableSecondProv">
										    <thead>
												<tr>
													<th width="10%">&nbsp;</th>
													<th width="25%">C&oacute;digo</th>
													<th width="65%">Descripci&oacute;n</th>
												</tr>
											</thead>
											<tbody style="height:150px">
											</tbody>
										</table>
					 				</div>
					 			</div>
					 			<div class="modal-footer">
					 			 <button type="button" class="btn btn-primary btnSelectProvModal" data-dismiss="modal">Seleccionar</button>
					 			 <button type="button" class="btn btn-primary btnSalirProvModal" data-dismiss="modal">Salir</button>
					 			</div>
					 		</div>
					 	</div>
					 </div>
					 <!-- Fin de la ventana modal -->
			
			
            <div class="clear p-bottom"></div>
            
            <div class="todo">
            
			<table class="table table-striped table-fixedheader firstTable">
			    <thead>
					<tr>
						
						<th width="15%">C&oacute;digo</th>
						<th width="50%">Descripci&oacute;n</th>
						<th width="10%">Stock</th>
						<th width="15%">Cantidad
							Solicitada</th>
						<th width="10%">&nbsp;</th>
					</tr>
				</thead>
				<tbody style="height:200px">
				   <tr>
				    <td width="15%"><input type="text" id="primero" class="input_pedido  form-control" name="id_producto"></td>
				    <td width="50%"></td>
				    <td width="10%"></td>
				    <td width="15%"><div><input type="number" class="input_pedido form-control cantidad" value="0" name="cantidadCompra" disabled></div></td>
				    <td width="10%"><a href="#" class="btn btn-inverse none"><i class="glyphicon glyphicon-remove"></i></a ></td>
				  </tr>
				 </tbody>
			</table>
					
			
			</div>
			<div class="clear"></div>
			
			<div class="">
				<div class="left">
					 <button type="button" class="btn btn-primary search" data-toggle="modal" data-target="#buscarProducto">Buscar Producto</button>
					 			 
					 <!-- toda esta parte es para la ventana modal de busqueda de productos -->
					 <div class="modal fade" id="buscarProducto" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					 	<div class="modal-dialog">
					 		<div class="modal-content">
					 			<div class="modal-header">
					 			 	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					 			 	<h4>Busqueda de productos</h4>
					 			</div>
					 			<div class="modal-body">
					 				<div class="row">
						 				<div class="col-md-10">
							 				<div class="row firstSearchRow" >
								 				<div class="col-md-4">
									 				<select class="form-control searchCategoria">
													  <option value="Categoria">Categoria</option>
													  <% CategoriaAdapter ca = new CategoriaAdapter();
													  	 List<Categoria> categorias = ca.devolverTodos();
													  	 for(Categoria c: categorias){
													  %>
													  		<option value="<%=c.getIdCategoria()%>"><%=c.getDescCategoria()%></option>		 
													  <%	 
													     }
													  %>
													  
													</select>
												</div>
												<div class="col-md-4">
									 				<select class="form-control searchRubro">
													  <option value="Rubro">Rubro</option>
													  <% RubroAdapter ra = new RubroAdapter();
													  	 List<Rubro> rubros = ra.devolverTodos();
													  	 for(Rubro r: rubros){
													  %>
													  		<option value="<%=r.getIdRubro()%>"><%=r.getDescRubro()%></option>		 
													  <%	 
													     }
													  %>
													</select>
												</div>
												<div class="col-md-4">
									 				<select class="form-control searchSubRubro">
													  <option value="SubRubro">Sub-Rubro</option>
													  <% SubRubroAdapter sra = new SubRubroAdapter();
													  	 List<SubRubro> subrubros = sra.devolverTodos();
													  	 for(SubRubro sr: subrubros){
													  %>
													  		<option value="<%=sr.getIdSubRubro()%>"><%=sr.getDecSubRubro()%></option>		 
													  <%	 
													     }
													  %>
													</select>
												</div>									
							 				</div>
							 				<div class="row modalrow2" >
								 				<div class="col-md-8">
									 				<input type="text" class="form-control searchDesc">
												</div>
												<div class="col-md-4">
									 				<select class="form-control searchMarca">
													  <option value="Marca">Marca</option>
													  <% MarcaAdapter ma = new MarcaAdapter();
													  	 List<Marca> marcas = ma.devolverTodos();
													  	 for(Marca m: marcas){
													  %>
													  		<option value="<%=m.getIDMarca()%>"><%=m.getDescMarca()%></option>		 
													  <%	 
													     }
													  %>
													</select>
												</div>									
							 				</div>
						 				</div>
						 				<div class="col-md-2 searchButton">
						 				  <a href="#" class="btn btn-primary btn-lg"><i class="icon-white glyphicon glyphicon-search"></i></a>
						 				</div>
					 				</div>
					 				<div class="row modalrow2">
					 					<table class="table table-striped table-fixedheader tableSecond">
										    <thead>
												<tr>
													<th width="5%">&nbsp;</th>
													<th width="25%">Codigo</th>
													<th width="70%">Descripcion</th>
												</tr>
											</thead>
											<tbody style="height:150px">
											</tbody>
										</table>
					 				</div>
					 			</div>
					 			<div class="modal-footer">
					 			 <button type="button" class="btn btn-primary btnAddModal" data-dismiss="modal">Agregar</button>
					 			 <button type="button" class="btn btn-primary btnCloseModal" data-dismiss="modal">Salir</button>
					 			</div>
					 		</div>
					 	</div>
					 </div>
					 <!-- Fin de la ventana modal -->
					 
				</div>
				<div class="right">
					 <button type="submit" class="btn btn-primary confirm">Confirmar</button>
					 <!-- <button type="button" class="btn btn-primary cancel">Cancelar</button> -->
					 <a href="index.jsp" class="btn btn-primary">Cancelar</a>
				</div>
			</div>
			<div class="clear"></div>
			</form>
		</div>
	</div>
</div>
</body>
</html>